package javase0822;

import java.util.Arrays;

public class Demo06 {
    public static void main(String[] args) {
        String[] arr = new String[] {"q", "手填", "与",
                "尔萨任天堂", "a", "5"};

        for (String temp : arr) {
            System.out.println(temp);
            int n = temp.length();
            System.out.println(n);
            n = temp.hashCode();
            System.out.println(n);

        }
        // 预期的结果：
        // "q", "手填", "与", "尔萨任天堂", "a", "5"
        // 113  802688 19982 1322450208  97  53
        // "5" "a" "q" "与" "手填" "尔萨任天堂"

        // 113 19982  802688 97   53  1322450208
        for (int j = 0; j < arr.length - 1; j++) {
            for (int i = 0; i < arr.length - 1; i++) {
                // arr[i]  arr[i + 1]
                if (arr[i].hashCode() > arr[i + 1].hashCode()) {
                    String temp = arr[i];
                    arr[i] = arr[i + 1];
                    arr[i + 1] = temp;
                }
            }
        }
        System.out.println(Arrays.toString(arr));
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));

        String s = "你好";
        switch (s) {
            case "你好" :
                System.out.println("1");
                break;
            case "你好2" :
                System.out.println("2");
                break;
            case "你3好" :
                System.out.println("3");
                break;
        }

    }
}
